package com.mmlc.meimei.lichengkongjian.dialog;

import android.view.View;
import android.widget.TextView;

import com.androidnetframe.utils.DateUtils;
import com.mmlc.meimei.lichengkongjian.R;

import java.util.Date;

/**
 * Created by admin on 2018/1/17.
 */

public class SanTianDialog extends BaseCenterFragmentDialog implements View.OnClickListener {

    TextView d1,d2,d3;
    ResponseListener<String> listener;
    @Override
    protected void initViews() {
        v=inflater.inflate(R.layout.dialog_santian,null);
        d1= (TextView) v.findViewById(R.id.day1);
        d2= (TextView) v.findViewById(R.id.day2);
        d3= (TextView) v.findViewById(R.id.day3);
        d1.setOnClickListener(this);
        d2.setOnClickListener(this);
        d3.setOnClickListener(this);
        Date date=new Date();
        d1.setText(DateUtils.addDay(date,"yyyy-MM-dd",1));
        d2.setText(DateUtils.addDay(date,"yyyy-MM-dd",2));
        d3.setText(DateUtils.addDay(date,"yyyy-MM-dd",3));
    }

    @Override
    public void onClick(View view) {
        listener.response(((TextView)view).getText().toString().trim());
        dismiss();
    }
    public void setListener(ResponseListener<String> listener){
        this.listener=listener;
    }

}
